package com.jt.springboot_demo1.controller;

import com.jt.springboot_demo1.pojo.User;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :Colin
 * @version 创建时间: 2021/7/21 16:15
 */
@RestController
//springr容器启动时，动态添加配置文件 一般需要修改字符集
@PropertySource(value = "classpath:/person.properties",encoding = "utf-8")

public class HelloController {
    //private String day="1天";
    @Value("${user.day}")
    private String day;
    @Value("${person.name}")
    private String name;
    @RequestMapping("/getMsg")
    public String getDay(){

        return "这个雨"+day+name;
    }
    public void testLombok(){
        User user = new User();
        user.setId(1).setName("String");
    }

}
